package com.taotao.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.taotao.common.EasyUIDataGridResult;
import com.taotao.mapper.TbItemParamMapper;
import com.taotao.pojo.TbItemParam;
import com.taotao.pojo.TbItemParamExample;
import com.taotao.service.ItemParameterService;

@Service
public class ItemParameterServiceImpl implements ItemParameterService {

	@Autowired
	private TbItemParamMapper tbItemParamMapper;

	@Override
	public EasyUIDataGridResult getIPIResult(int page, int rows) {
		PageHelper.startPage(page, rows);
		TbItemParamExample tbItemParamExample = new TbItemParamExample();
		List<TbItemParam> selectByExampleWithBLOBs = tbItemParamMapper
				.selectByExampleWithBLOBs(tbItemParamExample);
		PageInfo<TbItemParam> pageInfo = new PageInfo<TbItemParam>(
				selectByExampleWithBLOBs);
		EasyUIDataGridResult easyUIDataGridResult = new EasyUIDataGridResult();
		easyUIDataGridResult.setRows(selectByExampleWithBLOBs);
		easyUIDataGridResult.setTotal(pageInfo.getTotal());
		return easyUIDataGridResult;
	}
}
